#ifndef PARTITION_H
#define PARTITION_H

#include <vector>

void printPartition(std::vector<int>& part);

class Partition {
        private:
                std::vector<int> currPart;
                int Number;
        public:
                class Iterator {
                        friend class Partition;
                        Partition* partition;
                        public:
                                Iterator(void) { partition = 0; }
                                Iterator(const Iterator& i) { partition = i.partition; }
                                Iterator(Partition& p) { partition = &p; }
                                std::vector<int>& operator*(void) { return (std::vector<int>&) partition->currPart; }
                                Iterator operator++(void);
                                bool operator==(Iterator op2)
                                        { if(partition&&op2.partition) {
                                                return (partition->currPart==op2.partition->currPart) ?
                                                true : false; }
                                        else {
                                                return (partition==op2.partition) ? true : false; } }
                                bool operator!=(Iterator op2) { return !(*this==op2); }
                };
                friend class Iterator;
                Partition(int num) { Number = num; currPart.push_back(Number); }
                Iterator begin(void) { return Iterator(*this); }
                Iterator end(void) { return Iterator(); }
};

#endif // PARTITION_H
